feat!: remove TanStack, and own the form engine - #241
Closed
pathscale wants to merge 1 commit into
Closed
Conversation
Three TanStack packages were the last things pinning this library to Solid 1,
and none of them was earning its place.
`@tanstack/solid-table` backed seven public hooks that **nothing in this
library used**. `createDataGrid` already answers the same questions natively -
its rows derive `filteredRows -> sortedRows -> pageRows` with selection
alongside - so the hooks were a second table engine kept alive by their own
exports. `@tanstack/solid-virtual` was the same story in one file.
`useAnchoredOverlayPosition` stays: it never touched TanStack and a grid still
needs to position an overlay against a cell.
`@tanstack/solid-form` was different, and it is the work here. It was load
bearing: `FormField` rendered `<tsForm.Field>`, `FormSubmitButton` rendered
`<tsForm.Subscribe>`, and `FormApi` was literally `{ _tsForm: any }`, so
twelve erased generics were part of this library's public type.
The replacement is small because the field components already carry the hard
part - `Input`, `Select` and the rest own their presentation, `state="invalid"`
and error slot. What was missing was bookkeeping: values, touched, errors, and
when to run the schema. Standard Schema is called directly, which is what
TanStack was doing on our behalf anyway.
Two behaviours are now explicit rather than inherited. Errors are gated on
`isTouched` so a form does not open covered in red, and a failed `submit()`
touches every field, so the errors it refused on all become visible at once
rather than one blur at a time. There is a test for the second, which the old
suite had no way to express.
Also drops ten `@solid-primitives/*` packages. Every one was declared in
`package.json` and imported from nowhere - not in `src`, `tests`, `scripts` or
`playground`. 28 packages leave the install.
BREAKING CHANGE: `useTableModel`, `useTableSorting`, `useTablePagination`,
`useTableFiltering`, `useTableSelection`, `useTableExpansion`,
`toSortDescriptor`, `toSortingState` and `useVirtualRows` are removed, with
their option and result types. Use `createDataGrid`, which covers filtering,
sorting, pagination and selection; row expansion has no replacement yet.
`FormApi._tsForm` is gone, replaced by `values()`, `getFieldValue`,
`getFieldMeta`, `setFieldValue`, `validateField`, `submit()`, `isSubmitting()`
and `isValid()`.
Owner
Author
|
Superseded by #242, which now targets |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #240 (glass). Review that first; this PR's diff is only the TanStack removal.
Three TanStack packages were the last things pinning this library to Solid 1, and none was earning its place.
solid-table and solid-virtual: shims nothing used
@tanstack/solid-tablebacked seven public hooks that no component in this library used.createDataGridalready answers the same questions natively — its rows derivefilteredRows → sortedRows → pageRows, with selection alongside — so the hooks were a second table engine kept alive only by their own exports.@tanstack/solid-virtualwas the same story in one file.useAnchoredOverlayPositionstays. It never touched TanStack, and a grid still needs to position an overlay against a cell.solid-form: load-bearing, so replaced
This one was real.
FormFieldrendered<tsForm.Field>,FormSubmitButtonrendered<tsForm.Subscribe>, andFormApiwas literally{ _tsForm: any }— twelve erased generics were part of this library's public type.The replacement is small because the field components already carry the hard part:
Input,Select,Checkboxand the rest own their presentation,state="invalid"and error slot. What was missing is bookkeeping — values, touched, errors, and when to run the schema. Standard Schema is now called directly, which is what TanStack was doing on our behalf anyway.Two behaviours are explicit rather than inherited:
isTouched, so a form does not open covered in redsubmit()touches every field, so every error it refused on becomes visible at once rather than one blur at a timeThere is a test for the second. The old suite had no way to express it.
Also: ten dead dependencies
Every
@solid-primitives/*package was declared inpackage.jsonand imported from nowhere — notsrc,tests,scriptsorplayground. Removed with the rest. 28 packages leave the install.Verification
tsc --noEmit— cleanbun run check— 90/90 components passbun run build— cleanbun test— 86/86 pass (was 85; one added for the submit-touches-everything rule)Breaking changes
useTableModel,useTableSorting,useTablePagination,useTableFiltering,useTableSelection,useTableExpansion,toSortDescriptor,toSortingStateanduseVirtualRowsare removed with their option/result types. UsecreateDataGrid; row expansion has no replacement yet and is the one capability lost.FormApi._tsFormis gone, replaced byvalues(),getFieldValue,getFieldMeta,setFieldValue,validateField,submit(),isSubmitting(),isValid().